package com.naiterui.ehp.bs.cms.modules.wms.feign;

import javax.validation.constraints.NotNull;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import com.naiterui.ehp.bp.bo.b2c.SkuUsageBO;
import com.naiterui.ehp.bp.bo.medication.MedicationDefaultUsageBO;
import com.naiterui.ehp.bp.support.config.FeignConfiguration;
import com.naiterui.ehp.bp.support.exception.BusinessException;

/**
 * 调用b2c
 * 
 * @author yangfuya
 */
@FeignClient(name = "medicalBc", url = "${ehp.domain.b2c}", configuration = FeignConfiguration.class)
public interface IB2cFeignClient {

    /**
     * 根据sku获取详情
     * 
     * @param skuId
     * @return
     * @throws BusinessException
     */
    @GetMapping("/inner/medicine/usage/get/{skuId}")
    MedicationDefaultUsageBO getBySkuId(@PathVariable("skuId") Long skuId) throws BusinessException;

    /**
     * 新增或修改药品默认用法用量和安全用量
     * 
     * @param medicationDefaultUsageBO
     */
    @PostMapping("/inner/medicine/usage")
    void insertOrUpdate(@NotNull @RequestBody MedicationDefaultUsageBO medicationDefaultUsageBO);

    /**
     * 修改该sku的默认用法用量和安全用量
     * 
     * @param skuUsageBO
     * @throws BusinessException
     */
    @PostMapping("/inner/cms/sku/updateSkuUsage")
    void updateSkuUsage(@RequestBody SkuUsageBO skuUsageBO) throws BusinessException;
}
